home *** CD-ROM | disk | FTP | other *** search
- tell application "Finder"
- set picFile to file "plaid.pict" of folder "Plaid" of startup disk as alias
- end tell
- tell application "Appearance"
- activate
- set picture file of monitor 1 to picFile
- set picture positioning of monitor 1 to centered
- quit
- end tell
- repeat
- delay 15
- tell application "Finder"
- set theWidth to 128
- set theHeight to 128
- set theBounds to bounds of content space of desktop
- set theRight to item 3 of theBounds
- set theBottom to item 4 of theBounds
- set myTop to (theBottom - theHeight) / 2
- set myLeft to (theRight - theWidth) / 2
- set myBottom to (theBottom + theHeight) / 2
- set myRight to (theRight + theWidth) / 2
- set myRect to {{myLeft, myTop}, {myRight, myBottom}}
- set myFiles to every item in desktop
- set myList to {}
- repeat with myfile in myFiles
- if my isInRect(position of myfile, myRect) then
- set myList to myList & myfile
- end if
- end repeat
- if (count of items of myList) > 0 then
- my Pocketize()
- my toPocket(myList)
- end if
- end tell
- end repeat
- on isInRect(myPoint, myRect)
- set x to item 1 of myPoint
- set x1 to item 1 of item 1 of myRect
- set x2 to item 1 of item 2 of myRect
- set y to item 2 of myPoint
- set y1 to item 2 of item 1 of myRect
- set y2 to item 2 of item 2 of myRect
- set isIn to ((x1 < x and x < x2) and (y1 < y and y < y2))
- end isInRect
-
- on toPocket(theList)
- tell application "Finder"
- repeat with myItem in theList
- move (myItem) to (folder "Shallow Pocket" of startup disk)
- end repeat
- end tell
- end toPocket
-
- on Pocketize()
-
- tell application "Finder"
- if not ((folder "Shallow Pocket" of startup disk) exists) then
- make new folder in startup disk
- set name of result to "Shallow Pocket"
- end if
- if not ((folder "Shallow Pocket:Pocket" of startup disk) exists) then
- make new folder in folder "Shallow Pocket" of startup disk
- set name of result to "Pocket"
- end if
- if not ((folder "Pocket" of desktop) exists) then
- make new folder at desktop
- set name of result to "Pocket"
- end if
- move every item in folder "Shallow Pocket" of startup disk to folder "Pocket" of desktop
- move folder "Pocket" of desktop to folder "Shallow Pocket" of startup disk
- end tell
- end Pocketize
-
-